package com.xy.annotaion.handler.kotlin.pdf

import com.itextpdf.html2pdf.HtmlConverter
import com.xy.annotaion.handler.kotlin.p
import org.jsoup.Jsoup
import java.io.FileOutputStream

//html to pdf 效果不好 ！！！
fun main() {
//    val con = Jsoup.connect("https://www.baidu.com")
    val con = Jsoup.connect("https://blog.csdn.net/weixin_30294295/article/details/99769719")
    val r = con.execute()
    p(r.body())

//    val converterPros = ConverterProperties()
    HtmlConverter.convertToPdf(r.body(), FileOutputStream("html.pdf"))

    p("end html to pdf")

}